package com.crm.exception;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

/**配置全局异常处理类
 *  优先级别低于局部异常处理类
 * @author SMILE
 */
@Configuration
public class GolbalException implements HandlerExceptionResolver{
	@Override
	/**
	 * 异常
	 * @return
	 */
	public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler,
			Exception ex) {
		ModelAndView mv = new ModelAndView("error");
		mv.addObject("msg", "全局异常处理");
		ex.printStackTrace();
		return mv;
	}
}

